package com.ruoyi.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.CompletionField;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.core.completion.Completion;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author hlf
 * @createTime 2025/2/10 16:12
 * @description 文档
 */
@Data
@Document(indexName = "article")
public class Article {

    @Id
    private String id;

    @Field(type = FieldType.Text, analyzer = "text_analyzer", searchAnalyzer = "ik_smart")
    private String content;

    @Field(type = FieldType.Text, analyzer = "text_analyzer", searchAnalyzer = "ik_smart")
    private String title;

    @Field(type = FieldType.Float)
    private Float price;

    @Field(type = FieldType.Date)
    private Date createTime;

    @CompletionField(analyzer="text_analyzer",searchAnalyzer="ik_smart", maxInputLength = 100)
    private Completion suggestion;

    private String suggestionText;


}
